package com.hongpu.controller;

import com.hongpu.domain.CoolTowerEmployee;
import com.hongpu.dto.CoolTowerEmployeeDto;
import com.hongpu.service.CoolTowerEmployeeService;
import com.hongpu.utils.ResultDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 冷却塔安装人员
 *
 * @author 张玉胜
 * @since 2025年06月11日
 */
@RestController
@RequestMapping("/coolTowerEmployee")
public class CoolTowerEmployeeController {
    @Autowired
    CoolTowerEmployeeService coolTowerEmployeeService;

    /**
     * 新增
     */
    @PostMapping("/add")
    public ResultDto add(@RequestBody CoolTowerEmployee coolTowerEmployee) {
        return coolTowerEmployeeService.add(coolTowerEmployee);
    }

    /**
     * 修改
     */
    @PostMapping("/update")
    public ResultDto update(@RequestBody CoolTowerEmployee coolTowerEmployee) {
        return coolTowerEmployeeService.update(coolTowerEmployee);
    }

    /**
     * 删除
     */
    @GetMapping("/delete/{id}")
    public ResultDto delete(@PathVariable("id") Long id) {
        return coolTowerEmployeeService.delete(id);
    }

    /**
     * 启用
     */
    @GetMapping("/active/{id}")
    public ResultDto active(@PathVariable("id") Long id) {
        return coolTowerEmployeeService.active(id);
    }

    /**
     * 分页
     */
    @PostMapping("/page")
    public ResultDto page(@RequestBody CoolTowerEmployeeDto coolTowerEmployeeDto) {
        return coolTowerEmployeeService.page(coolTowerEmployeeDto);
    }

    /**
     * 获取人员编号
     */
    @GetMapping("/getWorkNum")
    public ResultDto getWorkNum() {
        return coolTowerEmployeeService.getWorkNum();
    }

    /**
     * 获取在职状态
     */
    @GetMapping("/getOnDutyStatus")
    public ResultDto getOnDutyStatus() {
        return coolTowerEmployeeService.getOnDutyStatus();
    }

    /**
     * 选择人员时用到的下拉列表
     */
    @GetMapping("/selectEmployeeList")
    public ResultDto selectEmployeeList() {
        return coolTowerEmployeeService.selectEmployeeList();
    }

    /**
     * 根据用户ID获取用户信息
     */
    @GetMapping("/getInfoById/{id}")
    public ResultDto getInfoById(@PathVariable("id") Long id) {
        return coolTowerEmployeeService.getInfoById(id);
    }
    /**
     * 查询用户打过卡的项目
     */
    @GetMapping("/getProjectList/{id}")
    public ResultDto getProjectList(@PathVariable("id") Long id) {
        return null;
    }
}